import Vue from 'vue'
import Router from 'vue-router'

//订单列表
const index = r => require.ensure([], () => r(require('@/components/index')), 'index')

//商品列表
const prcList = r => require.ensure([], () => r(require('@/components/prcList')), 'prcList')
const prcAdd = r => require.ensure([], () => r(require('@/components/prcAdd')), 'prcAdd')

//广告图
const bannerList = r => require.ensure([], () => r(require('@/components/bannerList')), 'bannerList')
const bannerAdd = r => require.ensure([], () => r(require('@/components/bannerAdd')), 'bannerAdd')

//商品类型
const classList = r => require.ensure([], () => r(require('@/components/classList')), 'classList')
const classAdd = r => require.ensure([], () => r(require('@/components/classAdd')), 'classAdd')

//地区管理
const addressList = r => require.ensure([], () => r(require('@/components/addressList')), 'addressList')
const addressAdd = r => require.ensure([], () => r(require('@/components/addressAdd')), 'addressAdd')

//商品地区管理
const regionList = r => require.ensure([], () => r(require('@/components/regionList')), 'regionList')
const regionAdd = r => require.ensure([], () => r(require('@/components/regionAdd')), 'regionAdd')

//地区商品管理
const regionPrcList = r => require.ensure([], () => r(require('@/components/regionPrcList')), 'regionPrcList')
const regionPrcAdd = r => require.ensure([], () => r(require('@/components/regionPrcAdd')), 'regionPrcAdd')

//配送方式
const deliveryList = r => require.ensure([], () => r(require('@/components/deliveryList')), 'deliveryList')
const deliveryAdd = r => require.ensure([], () => r(require('@/components/deliveryAdd')), 'deliveryAdd')


//会员列表
const peopleList = r => require.ensure([], () => r(require('@/components/peopleList')), 'peopleList')
const peopleList2 = r => require.ensure([], () => r(require('@/components/peopleList2')), 'peopleList2')

//管理员管理
const adminList = r => require.ensure([], () => r(require('@/components/adminList')), 'adminList')
const adminAdd = r => require.ensure([], () => r(require('@/components/adminAdd')), 'adminAdd')


//订单列表
const orderList = r => require.ensure([], () => r(require('@/components/orderList')), 'orderList')
const orderListShow = r => require.ensure([], () => r(require('@/components/orderListShow')), 'orderListShow')
const orderPrint = r => require.ensure([], () => r(require('@/components/orderPrint')), 'orderPrint')
const sallAdd = r => require.ensure([], () => r(require('@/components/sallAdd')), 'sallAdd')
const sallList = r => require.ensure([], () => r(require('@/components/sallList')), 'sallList')


Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'index',
      component: index
    },
    {
      path: '/prcList',
      component: prcList
    },
    {
      path: '/prcAdd',
      component: prcAdd
    },
    {
      path: '/classList',
      component: classList
    },
    {
      path: '/classAdd',
      component: classAdd
    },
    {
      path: '/bannerList',
      component: bannerList
    },
    {
      path: '/bannerAdd',
      component: bannerAdd
    },
    {
      path: '/addressList',
      component: addressList
    },
    {
      path: '/addressAdd',
      component: addressAdd
    },
    {
      path: '/regionList',
      component: regionList
    },
    {
      path: '/regionAdd',
      component: regionAdd
    },
    {
      path: '/adminList',
      component: adminList
    },
    {
      path: '/adminAdd',
      component: adminAdd
    },
    {
      path: '/regionPrcList',
      component: regionPrcList
    },
    {
      path: '/regionPrcAdd',
      component: regionPrcAdd
    },
    {
      path: '/deliveryList',
      component: deliveryList
    },
    {
      path: '/deliveryAdd',
      component: deliveryAdd
    },
    {
      path: '/orderList',
      component: orderList
    },
    {
      path: '/orderListShow',
      component: orderListShow
    },
    {
      path: '/orderPrint',
      component: orderPrint
    },
    {
      path: '/peopleList',
      component: peopleList
    },
    {
      path: '/peopleList2',
      component: peopleList2
    },
    {
      path: '/sallAdd',
      component: sallAdd
    },
    {
      path: '/sallList',
      component: sallList
    },
    {
      path: '/*',
      component: index
    }
  ]
})
